//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.gemstone.panel;

import com.tool.tcpimg.UIUtils;
import com.updateNew.MyIsif;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.LayoutManager;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import org.come.entity.Goodstable;

public class GemstoneTabPanel extends JPanel {
    private int type;
    private JLabel goodsIcon;
    private JLabel goodsName;
    private JLabel[] mountLabel;
    private Goodstable[] goods;
    private ImageIcon iconBack;

    public GemstoneTabPanel(int type) {
    		this.type = type;
    		this.setPreferredSize(new Dimension(150, 68));
    		this.setOpaque(false);
    		this.setLayout(null);
    		//组件初始化
    		goods = new Goodstable[4];
    		goodsIcon = new JLabel();
    		goodsName = new JLabel("武器");
    		mountLabel = new JLabel[3];
    		for (int i = 0; i < mountLabel.length; i++) {
    			mountLabel[i] = new JLabel();
    			mountLabel[i].setBounds(68+i*29, 33, 25, 25);
    			mountLabel[i].setOpaque(false);
    			this.add(mountLabel[i]);
    		}
    		//组件设置位置
    		goodsIcon.setBounds(10, 8, 53, 51);
    		goodsName.setBounds(68, 8, 80, 20);
    		//组件透明化
    		goodsIcon.setOpaque(false);
    		goodsName.setOpaque(false);
    		if(type !=2){
    			mountLabel[2].setOpaque(false);
    		}
    		//组件改变字体颜色
    		goodsName.setForeground(new Color(187,165,75));
    		//组建设置字体
    		goodsName.setFont(UIUtils.TEXT_HY16);
    		//添加组件
    		this.add(goodsName);
    		this.add(goodsIcon);

    }

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        	if(iconBack == null){
    			if(type ==2){
    				iconBack = new ImageIcon("inkImg/hongmu/gemstone/选项卡2个宝石w150,h68px.png");
    			}else{
    				iconBack = new ImageIcon("inkImg/hongmu/gemstone/选项卡3个宝石w150,h68px.png");
    			}
    		}
    		g.drawImage(iconBack.getImage(), 0, 0, 150, 68, this);

    }

    public int getType() {
        return this.type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public JLabel getGoodsIcon() {
        return this.goodsIcon;
    }

    public void setGoodsIcon(JLabel goodsIcon) {
        this.goodsIcon = goodsIcon;
    }

    public JLabel getGoodsName() {
        return this.goodsName;
    }

    public void setGoodsName(JLabel goodsName) {
        this.goodsName = goodsName;
    }

    public JLabel[] getMountLabel() {
        return this.mountLabel;
    }

    public void setMountLabel(JLabel[] mountLabel) {
        this.mountLabel = mountLabel;
    }

    public Goodstable[] getGoods() {
        return this.goods;
    }

    public void setGoods(Goodstable[] goods) {
        this.goods = goods;
    }
}
